// MeasurePane.cpp : implementation file
//

#include "stdafx.h"
#include "Measure.h"
#include "MeasurePane.h"


// CMeasurePane

IMPLEMENT_DYNAMIC(CMeasurePane, CDockablePane)

CMeasurePane::CMeasurePane()
{

}

CMeasurePane::~CMeasurePane()
{
}

void CMeasurePane::AdjustLayout(void)
{
  if (GetSafeHwnd() == NULL) {
    return;
  }

  CRect rectClient;
  GetClientRect(rectClient);

  md_.SetWindowPos(NULL, rectClient.left, rectClient.top,
    rectClient.Width(), rectClient.Height(), SWP_NOACTIVATE | SWP_NOZORDER);
}


BEGIN_MESSAGE_MAP(CMeasurePane, CDockablePane)
  ON_WM_CREATE()
  ON_WM_SIZE()
END_MESSAGE_MAP()



// CMeasurePane message handlers




int CMeasurePane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
  if (CDockablePane::OnCreate(lpCreateStruct) == -1)
    return -1;

  md_.Create(CMeasureDlg::IDD, this);
  AdjustLayout();

  return 0;
}


void CMeasurePane::OnSize(UINT nType, int cx, int cy)
{
  CDockablePane::OnSize(nType, cx, cy);
  AdjustLayout();
}
